package method_student;

public class MethodDemo07 {
    public static void main(String[] args) {
        fire();                            //发射了1枚导弹给D国
        fire("A国");               //发射了1枚导弹给A国
        fire("A国", 9999);   //发射了9999枚导弹给A国
    }
//    方法重载
    public static void text(){
        System.out.println("====text1=====");
    }
    public static void text(int a){
        System.out.println("====text2====");
    }


    public static void fire(){
        fire("D国");
    }
    public static void fire(String country){
        fire(country,1);
    }
    public static void fire(String country, int num){
        System.out.println("发射了" + num + "枚导弹给" + country);
    }
}
